package com.guigu.basedservice.service.impl;

import com.guigu.basedservice.entity.BaseServCatalog;
import com.guigu.basedservice.mapper.BaseServCatalogMapper;
import com.guigu.basedservice.service.BaseServCatalogService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 总部统一服务目录 服务实现类
 * </p>
 *
 * @author Heyuhang
 * @since 2024-09-26
 */
@Service
public class BaseServCatalogServiceImpl extends ServiceImpl<BaseServCatalogMapper, BaseServCatalog> implements BaseServCatalogService {

    @Autowired(required = false)
    private BaseServCatalogMapper baseServCatalogMapper;

    @Override
    public List<BaseServCatalog> list2() {
        return baseServCatalogMapper.list2();
    }

    @Override
    @Cacheable(value = "catalogCache", key = "'all'")
    public List<BaseServCatalog> getAllCatalogs() {
        return baseServCatalogMapper.findAll();
    }
}
